public class ChineseCharacterEncoding {
    public static void main(String[] args) throws Exception {
        String chineseString = "汉字";

        System.out.println("字符:");
        for (char c : chineseString.toCharArray()) {
            System.out.println(c);
        }
        
        System.out.println("字节（UTF-8编码）:");
        byte[] bytes = chineseString.getBytes("UTF-8");
        for (byte b : bytes) {
            System.out.println(b);
        }
    }
}
